You can use http://phpfiddle.org/ to test the code